VERSION 5.00
Begin VB.Form Form1 
   Caption         =   "Extracting SARS Response Data for Interface ..."
   ClientHeight    =   6075
   ClientLeft      =   60
   ClientTop       =   450
   ClientWidth     =   5055
   LinkTopic       =   "Form1"
   ScaleHeight     =   6075
   ScaleWidth      =   5055
   StartUpPosition =   3  'Windows Default
   Begin VB.CommandButton cmdEnd 
      Caption         =   "Close"
      Height          =   1095
      Left            =   960
      TabIndex        =   3
      Top             =   4560
      Width           =   2895
   End
   Begin VB.ListBox lstDisplay 
      Height          =   1620
      Left            =   240
      TabIndex        =   2
      Top             =   2760
      Width           =   4575
   End
   Begin VB.PictureBox Picture1 
      Height          =   1215
      Left            =   240
      Picture         =   "Form1.frx":0000
      ScaleHeight     =   1155
      ScaleWidth      =   4515
      TabIndex        =   1
      Top             =   120
      Width           =   4575
   End
   Begin VB.CommandButton cmdEnter 
      Caption         =   "Extract SARS response data"
      Height          =   1095
      Left            =   960
      TabIndex        =   0
      Top             =   1560
      Width           =   3015
   End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit

Private Sub cmdEnter_Click()
On Error GoTo PROC_EXIT
    Dim dllResponse As Object
    Dim dllDecline As Object
    Dim dllCancel As Object
    
    Dim blResponse As Boolean, blDecline As Boolean, blCancel As Boolean
    Dim nNumResRecords As String, nNumDeclRecords As String, nNumCancelRecords As String
    Dim strFailReason As String
    
'*********************************************************************************************************************
'Display the server choice screen
    Form1.Show
    Load frmServername
    frmServername.Show vbModal
'*********************************************************************************************************************


'*********************************************************************************************************************
'Normal responses
    Set dllResponse = CreateObject("Directive_Response.clsGetDirResData")
    
    blResponse = dllResponse.GetDirectiveRespData(strFailReason, nNumResRecords, ServerName)
    
    If blResponse = True Then
        lstDisplay.AddItem nNumResRecords & " directive response records were extracted and sent to MQ"
        lstDisplay.ListIndex = lstDisplay.ListCount - 1
    Else
        lstDisplay.AddItem strFailReason
    End If
        
    nNumResRecords = 0
'*********************************************************************************************************************


'*********************************************************************************************************************
'Declined responses
    Set dllDecline = CreateObject("Decline_Response.clsGetDeclineReasons")
    
    blDecline = dllDecline.GetDeclineReasons(strFailReason, nNumDeclRecords, ServerName)
    
    If blDecline = True Then
        lstDisplay.AddItem nNumDeclRecords & " decline response records were extracted and sent to MQ"
        lstDisplay.ListIndex = lstDisplay.ListCount - 1
    Else
        lstDisplay.AddItem strFailReason
    End If
    
    nNumDeclRecords = 0
'*********************************************************************************************************************


'*********************************************************************************************************************
'Cancelled Requests
    Set dllCancel = CreateObject("Cancel_Response.clsGetCancelDirData")
    
    blCancel = dllCancel.GetCancelDirective(strFailReason, nNumCancelRecords, ServerName)
    
    If blCancel = True Then
        lstDisplay.AddItem nNumCancelRecords & " cancel response records were extracted and sent to MQ"
        lstDisplay.ListIndex = lstDisplay.ListCount - 1
    Else
        lstDisplay.AddItem strFailReason
    End If
    
    nNumCancelRecords = 0
'*********************************************************************************************************************


PROC_EXIT:
    If Err.Number <> 0 Then
        MsgBox "An error occurred. " & Err.Description, vbCritical + vbOKOnly, "Error"
    End If
    
    Set dllResponse = Nothing
    Set dllDecline = Nothing
    Set dllCancel = Nothing
    
End Sub

Private Sub cmdEnd_Click()
    Unload Me
End Sub



